// 实现只读 readonly

type MyReadonly<T>={
    readonly[P in keyof T]:T[P]
}

interface Todo1 {
    title: string
    description: string
  }
  
  const todow2: MyReadonly<Todo1> = {
    title: "Hey",
    description: "foobar"
  }
  
//   todo.title = "Hello" // Error: cannot reassign a readonly property
//   todo.description = "barFoo" // Error: cannot reassign a readonly property